package com.ljx.recruitment.sale.service.impl.sms;

import cn.hutool.core.util.RandomUtil;
import com.ljx.recruitment.sale.constant.SaleConstant;
import com.ljx.recruitment.sale.service.SmsStrategy;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2025-02-15  15:02
 */
@Service
public class TrialApplicationSmsStrategy implements SmsStrategy {

    @Value("${spring.profiles.active}")
    private String profilesActive;
    @Override
    public String send(String phone) {
        if (SaleConstant.DEV.equals(profilesActive)) {
            return RandomUtil.randomNumbers(5);
        }
        // 接入短信服务
        return null;
    }

    @Override
    public boolean verify(String key, String code) {
        if (SaleConstant.DEV.equals(profilesActive)) {
            return true;
        }
        // 验证是否正确
        return false;
    }
}
